<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>大学生涯</title>
    <link rel="stylesheet" >
</head>
<body>
<header>
    <nav>
        <ul class="catalog">
            <li><a href="首页.html">首页</a></li>
            <li><a href="我的历程.html">我的历程</a></li>
            <li><a href="登录.html">登录</a></li>
        </ul>
    </nav>
</header>
<div class="carousel-container">
    <div class="carousel-slide">
        <div class="carousel-item"><img src="images/轮播图1.jpg" alt="Image 1"></div>
        <div class="carousel-item"><img src="images/轮播图2.jpg" alt="Image 2"></div>
        <div class="carousel-item"><img src="images/轮播图3.jpg" alt="Image 3"></div>
        <div class="carousel-item"><img src="images/轮播图4.jpg" alt="Image 3"></div>

        <button class="prev">&#10094;</button>
        <button class="next">&#10095;</button>

        <div class="carousel-indicators"></div>
</div>
</div>

<div class="container">
    <h1>我的大学生涯</h1>
    <div class="intro">
        <div class="section-title">自我介绍</div>
        <div class="personal-info">
            <div>个人信息<br>姓名：某某<br>性别：男<br>爱好：电影<br>学校：清华大学</div>
            <div>大学，是梦想开始的地方……<br><br>......（详细介绍）</div>
        </div>
    </div>
    <div class="hobbies">
        <div class="section-title">我的爱好</div>
        <div class="hobby-content">
            <div><img src="images/电影机.jpg" alt="电影投影机"></div>
            <div>我的梦想是当一名电影导演……<br><br>......（详细描述）</div>
        </div>
    </div>
    <div class="experience">
        <div class="section-title">我的经历</div>
        <div class="experience-content">
            <div>进入大学后我获得了许多时间来做自己喜欢的事……<br><br>......（详细描述）</div>
            <div><img src="images/青春梦想.jpg" alt="青春梦想"></div>
        </div>
    </div>
</div>
<div class="footer">
    <p>我的大学生涯 点击给我发送邮件</p>
</div>

        <script>
            let index = 0;
            const slides = document.querySelectorAll('.carousel-item');
            const totalSlides = slides.length;
            const indicators = document.querySelector('.carousel-indicators');

            function showSlide(n) {
            if (n >= totalSlides) { index = 0; }
            if (n < 0) { index = totalSlides - 1; }
            slides.forEach(slide => slide.style.transform = `translateX(-${index * 100}%)`);
        }

            function nextSlide() {
            index++;
            showSlide(index);
        }


    function updateIndicators() {
        const indicators = document.querySelectorAll('.carousel-indicator');
        indicators.forEach(indicator => indicator.classList.remove('active'));
        const currentIndicator = indicators[index];
        currentIndicator.classList.add('active');
    }


    //切换速度（毫秒）
    setInterval(nextSlide, 2000);

    for (let i = 0; i < totalSlides; i++) {
        const indicator = document.createElement('div');
        indicator.className = 'carousel-indicator';
        indicators.appendChild(indicator);
    }

    updateIndicators();

</script>

</body>
</html>

<style>

    /* 基本样式重置  */
    body, h1, h2, p, ul, li {
        margin: 0;
        padding: 0;
    }

    body {
        font-family: Arial, sans-serif;
        background-color: #f0f0f0;
    }

    /* 头部样式 */
    header {
        background-color: #333;
        color: #fff;
        padding: 10px 0;
    }
    header .catalog{
        position: relative;
        left:-100px;
    }
    nav ul {
        list-style: none;
        padding: 0;
        display: flex;
        justify-content: center;
    }

    nav li {
        margin: 0 10px;
    }

    nav a {
        color: #fff;
        text-decoration: none;
        padding:5px 10px;
        border-radius: 5px;
        transition: background-color 0.3s;
    }

    nav a:hover {
        background-color: #444;
    }

       /*轮播图*/
    .carousel-container {
        position: relative;
        width: 1800px;
        margin: auto;
        overflow: hidden;
    }
    .carousel-slide {
        display: flex;
        width: 100%;
    }
    .carousel-item {
        min-width: 100%;
        transition: ease 0.5s;
    }
    .carousel-item img {
        width: 1800px;
        height: 400px;
        display: block;
    }

    
    .prev, .next {
        cursor: pointer;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        color: white;
        font-size: 24px;
        background-color: rgba(0, 0, 0, 0.5);
        padding: 10px;
        border: none;
    }
    .prev { left: 0; }
    .next { right: 0; }

    /* 区块样式 */
    section {
        background-color: #fff;
        color: #333;
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 5px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    section h1, section h2 {
        color: #ff4500;
        margin-bottom: 10px;
    }

    section p {
        line-height: 1.6;
        margin-bottom: 10px;
    }

    /* 个人信息样式 */
    #introduction .personal-info {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    #introduction .personal-info span {
        margin-right: 20px;
        font-weight: bold;
    }



    /* 底部样式 */
    footer {
        background-color: #333;
        color: #fff;
        text-align: center;
        padding: 10px 0;
        position: absolute;
        bottom: 0;
        width: 100%;
    }

    /* 响应式设计 */
    @media (max-width: 768px) {
        nav li {
            margin: 0 5px;
        }
    }


    .container {
        width: 80%;
        margin: 0 auto;
        background-color: #fff;
        padding: 20px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
    h1 {
        text-align: center;
        color: #333;
    }
    .intro, .hobbies, .experience {
        margin-bottom: 20px;
    }
    .section-title {
        font-size: 1.5em;
        color: #333;
        border-bottom: 2px solid #f4f4f4;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    .personal-info, .hobby-content, .experience-content {
        display: flex;
        flex-wrap: wrap;
    }
    .personal-info div, .hobby-content div, .experience-content div {
        flex: 1;
        min-width: 200px;
        margin-right: 20px;
    }
    .personal-info div:last-child, .hobby-content div:last-child, .experience-content div:last-child {
        margin-right: 0;
    }
    .hobby-content img, .experience-content img {
        max-width: 100%;
        height: auto;
    }
    .footer {
        text-align: center;
        padding: 10px 0;
        background-color: #333;
        color: #fff;
        position: relative;
    }
</style>